QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

About Graphics Importer Components

Graphics importer components, introduced in QuickTime 2.5, provide a standard method for applications to open and display still images contained within graphics documents. Graphics importer components allow you to work with any type of image data, regardless of the file format or compression used in the document. You specify the document that contains the image, and the destination rectangle the image should be drawn into, and QuickTime handles the rest. More complex interactions are also supported.

Use the GetGraphicsImporterForFile function or the GetGraphicsImporterForDataRef function to obtain a graphics importer component instance for a particular file. Then you can use that component instance to find out the image file's characteristics and draw it. When you are done with the component instance, call CloseComponent .

The following example code ( Listing 16-1 ) shows the basic functions you use to draw an image file.

Listing 1 The basic functions used to draw an image file

void drawFile(const FSSpec *fss, const Rect *boundsRect)
    {
        GraphicsImportComponent gi;
        GetGraphicsImporterForFile(fss, &gi);
        GraphicsImportSetBoundsRect(gi, boundsRect);
        GraphicsImportDraw(gi);
        CloseComponent(gi);
    }

The same code can be used to display any image, regardless of the file format.

Supported Image File Formats

QuickTime Image File Format

How Graphics Importer Components Work

Registering Graphics Importer Components


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |